CREATE TABLE [dbo].[tb_servicioshistoricostemp]
(
[idServicioHistorico] [int] NOT NULL IDENTITY(1, 1),
[idAgente] [int] NOT NULL,
[NumeroOrden] [int] NULL,
[CargoGenerico] [int] NULL,
[AsignaturaGenerica] [int] NULL,
[Horas] [int] NULL,
[UbicacionOriginal] [int] NULL,
[DescrUbic] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Localidad] [int] NULL,
[SituacionRevista] [int] NULL,
[FechaAlta] [datetime] NULL,
[Baja] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FechaBaja] [datetime] NULL,
[FechaTermino] [datetime] NULL,
[NormaBaja] [int] NULL,
[CausaBaja] [int] NULL,
[CausaAlta] [int] NULL,
[TipoServicio] [int] NULL,
[Sistema] [int] NULL,
[RegimenLaboral] [int] NULL,
[Financiamiento] [int] NULL,
[Presupuesto] [int] NULL,
[Finalidad] [int] NULL,
[TipoDeFuncion] [int] NULL,
[RegimenSalarial] [int] NULL,
[RegimenDesignacion] [int] NULL,
[NroAfiliadoJubilacion] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CajaJubilacion] [int] NULL,
[NormaAlta] [int] NULL,
[CategoriaTitulo] [int] NULL,
[FechaDeCarga9] [datetime] NOT NULL CONSTRAINT [DF_tb_servicioshistoricostemp_FechaDeCarga9] DEFAULT (getdate()),
[ServicioAgente] [int] NULL,
[Nivel] [int] NULL,
[Ciclo] [int] NULL,
[Modalidad] [int] NULL,
[Zona] [int] NULL,
[grupoIncumbencias] [int] NULL,
[FechaPresentacion] [datetime] NULL,
[ClasificacionServCert] [int] NULL,
[Funcion] [int] NULL,
[Frente_Alumnos] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Categoria] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] ADD CONSTRAINT [PK_tb_servicioshistoricostemp] PRIMARY KEY CLUSTERED  ([idServicioHistorico]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_AsignaturasGenericas] FOREIGN KEY ([AsignaturaGenerica]) REFERENCES [dbo].[tb_AsignaturasGenericas] ([idAsignaturaGenerica])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_CargosGenericos] FOREIGN KEY ([CargoGenerico]) REFERENCES [dbo].[tb_CargosGenericos] ([idCargoGenerico])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_ClasificacionServCert] FOREIGN KEY ([ClasificacionServCert]) REFERENCES [dbo].[tb_ClasificacionServCert] ([IdClasificacion])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_Funciones] FOREIGN KEY ([Funcion]) REFERENCES [dbo].[tb_Funciones] ([idFuncion])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_GruposDeIncumbencias] FOREIGN KEY ([grupoIncumbencias]) REFERENCES [dbo].[tb_GruposDeIncumbencias] ([idGrupoIncumbencia])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_Localidades] FOREIGN KEY ([Localidad]) REFERENCES [dbo].[tb_Localidades] ([idLocalidad])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_ModalidadesEnsenanza] FOREIGN KEY ([Modalidad]) REFERENCES [dbo].[tb_ModalidadesEnsenanza] ([idModalidad])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_NivelesEnsenanza] FOREIGN KEY ([Nivel]) REFERENCES [dbo].[tb_NivelesEnsenanza] ([idNivelEnsenanza])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_TiposDeFuncion] FOREIGN KEY ([TipoDeFuncion]) REFERENCES [dbo].[tb_TiposDeFuncion] ([idTipoFuncion])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_TiposDeServicios] FOREIGN KEY ([TipoServicio]) REFERENCES [dbo].[tb_TiposDeServicios] ([idTipoDeServicio])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_Organizaciones] FOREIGN KEY ([UbicacionOriginal]) REFERENCES [dbo].[tb_Organizaciones] ([idOrganizaciones])
GO
ALTER TABLE [dbo].[tb_servicioshistoricostemp] WITH NOCHECK ADD CONSTRAINT [FK_tb_servicioshistoricostemp_tb_Zonas] FOREIGN KEY ([Zona]) REFERENCES [dbo].[tb_Zonas] ([idZona])
GO
